package com.binhai.db;

import org.springframework.jdbc.core.JdbcTemplate;

import javax.sql.DataSource;

public class SpringDB {
  //数据源DataSource
    private DataSource dataSource;

    public DataSource getDataSource() {
        return dataSource;
    }

    public void setDataSource(DataSource dataSource) {
        this.dataSource = dataSource;
    }
    //生成JdbcTemplate对象
    public JdbcTemplate getJdbcTemplate() {
        return new JdbcTemplate(dataSource);
    }
}
